package com.cuhk.common.exception;

public enum BizCodeEnum {

    UNKNOWN_EXCEPTION(10000, "未知异常"),
    SMS_TOO_SOON_EXCEPTION(10002, "验证码请求过于频繁"),
    SMS_FAIL_SEND(10003, "验证码发送失败"),
    VALID_EXCEPTION(10001, "参数格式校验失败"),
    PRODUCT_UP_EXCEPTION(11000, "商品上架异常"),

    // 会员服务相关错误码
    NAME_ALREADY_EXIST_EXCEPTION(12000, "用户名已经被注册"),
    PHONE_ALREADY_EXIST_EXCEPTION(12001, "手机号已经被注册"),
    NAME_FOUND_FAILED_EXCEPTION(12002, "用户名不存在"),
    PASSWORD_MATCH_FAILED_EXCEPTION(12003, "密码不正确");

    public int code;
    public String message;

    BizCodeEnum(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public int getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }
}
